#include <stdio.h>

#define NUM 1024  //缓冲区大小

#define BUFF_NONE 0x1 //无缓冲
#define BUFF_LINE 0x2 //行缓冲
#define BUFF_ALL 0x4  //全缓冲

typedef struct MY_FILE
{
  int fd;
  int flags;  //缓冲方式
  char outPutBuff[NUM]; //缓冲区
  int current;  //缓冲区下标
}MY_FILE;

int my_fflush(MY_FILE *stream);
MY_FILE *my_fopen(const char *path, const char *mode);
int my_fclose(MY_FILE *fp);
size_t my_fread(void *ptr, size_t size, size_t nmemb, MY_FILE *stream);
size_t my_fwrite(const void *ptr, size_t size, size_t nmemb, MY_FILE *stream);